import request from '@/config/axios'

export interface AcqLinkVO {
  id: number
  weLinkId: string
  weLinkName: string
  weLinkUrl: string
  skipVerify: number
  priorityType: number
  priorityUserList: string
  corpId: string
}

// 查询获客链接列表
export const getAcqLinkPage = async (params) => {
  return await request.get({ url: `/wecom/acq-link/page`, params })
}

// 查询获客链接详情
export const getAcqLink = async (id: number) => {
  return await request.get({ url: `/wecom/acq-link/get?id=` + id })
}

// 新增获客链接
export const createAcqLink = async (data: AcqLinkVO) => {
  return await request.post({ url: `/wecom/acq-link/create`, data })
}

// 修改获客链接
export const updateAcqLink = async (data: AcqLinkVO) => {
  return await request.put({ url: `/wecom/acq-link/update`, data })
}

// 删除获客链接
export const deleteAcqLink = async (id: number) => {
  return await request.delete({ url: `/wecom/acq-link/delete?id=` + id })
}

// 导出获客链接 Excel
export const exportAcqLink = async (params) => {
  return await request.download({ url: `/wecom/acq-link/export-excel`, params })
}

// 同步获客链接
export const syncAcqLink = async () => {
  return await request.post({ url: `/wecom/acq-link/sync-acq-link` })
}
// 查询客户列表
export const getAcqCustomerPage = async (params) => {
  return await request.get({ url: `/wecom/acq-link-user/page`, params })
}

// 新增获客链接
export const getUseStat = async (data) => {
  return await request.post({ url: `/wecom/acq-link/get-use-stat`, data })
}
